using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Collections;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Jonathan.Tabber
{
    public partial class frmFloatingGroup : Form
    {
        private Tabber m_Tabber;
        private List<TabberGroup> m_Groups;

        public frmFloatingGroup(Tabber tabber)
        {
            InitializeComponent();

            this.m_Tabber = tabber;
            this.m_Groups = new List<TabberGroup>();
        }

        internal void AddGroup(TabberGroup group)
        {
            this.m_Groups.Add(group);
        }

        internal void RemoveGroup(TabberGroup group)
        {
            for (int a = 0; a < this.m_Groups.Count; a++)
            {
                TabberGroup group2 = (TabberGroup)this.m_Groups[a];
                if (group == group2)
                {
                    this.m_Groups.RemoveAt(a);
                    break;
                }
            }
        }

        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);
            for (int a = 0; a < this.m_Groups.Count; a++)
            {
                TabberGroup group = (TabberGroup)this.m_Groups[a];
                this.m_Tabber.RemoveGroup(group);
            }
        }
    }
}